Implement gdk_beep() (woohoo!)
authorElliot Lee <sopwith@src.gnome.org>
Wed, 9 Aug 2000 16:12:06 +0000 (16:12 +0000)
committerElliot Lee <sopwith@src.gnome.org>
Wed, 9 Aug 2000 16:12:06 +0000 (16:12 +0000)
Implement gdk_beep() (woohoo!)

gdk/linux-fb/gdkinput-ps2.c
gdk/linux-fb/gdkmain-fb.c

index cb57ecb8d1c80833ca35b8285d25ac1d03f5de46..1e96eabdef5e45f7d57a486280dbea159eaddb0d 100644 (file)
@@ -23,6 +23,7 @@
 #include "gdkkeysyms.h"
 #include "gdkprivate-fb.h"
 #include <unistd.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <time.h>
@@ -1448,6 +1449,22 @@ tty_keyboard_open(void)
   return retval;
 }
 
+void
+gdk_beep (void)
+{
+  static int pitch = 600, duration = 100;
+  gulong arg;
+
+  if(!keyboard)
+    return;
+
+  /* Thank you XFree86 */
+  arg = ((1193190 / pitch) & 0xffff) |
+    (((unsigned long)duration) << 16);
+
+  ioctl(keyboard->fd, KDMKTONE, arg);
+}
+
 void
 keyboard_init(void)
 {
index f506537c377e9c02e22e9a413f52eaf97cb27b50..c81088fd719ecb051ecbcb367ef37a6407ca9d0d 100644 (file)
@@ -467,11 +467,6 @@ gdk_key_repeat_restore (void)
 }
 
 
-void
-gdk_beep (void)
-{
-}
-
 extern void keyboard_shutdown(void);
 
 void